<?php

class TestViewHandler2 implements Base\ViewHandler
{
    public $vars = array();
    
    function __construct( $tplName )
    {
        $this->name = $tplName;
        $this->result = new stdClass;
    }
    
    function assign( $name, $value )
    {
        $this->vars[$name] = $value;
    }
    
    function render()
    {
        $this->result->name = $this->name;
        $this->result->vars = $this->vars;
    }
    
    function getName() { return $this->name; }
    function getResult( $flag = TRUE ) 
    { 
        return 'Name: '.$this->name.', Vars: '. str_replace("\n", "[CR]", var_export( $this->vars, TRUE ));
    }
}
